<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>vue对象操作</title>
		<script src="https://cdn.jsdelivr.net/npm/vue"></script>
	</head>

	<body>
		<ul id="app">
			<li v-for="item in userInfo">{{item}}</li>
		</ul>
		<script>
			var vm = new Vue({
				el: '#app',
				data: {
					userInfo: {
						name: 'wangchao'
					}
				}
			})
			vm.$set(vm.userInfo, 'age', 30);
			//          Vue.set(vm.userInfo,'age',30);
			vm.userInfo = Object.assign({}, vm.userInfo, {
				age: 27,
				favoriteColor: 'Vue Green'
			})
		</script>
	</body>

</html>